package com.oa.code;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class DrawGraphics {

	public static void main(String[] args) {
		int width=800;
		  int height=800;  
		  File file = new File("D:/barcode/image.jpeg");
		  BufferedImage bi = new BufferedImage(width, height,
		    BufferedImage.TYPE_INT_RGB);//RGB��ʽ
		  Graphics2D g2 = (Graphics2D) bi.getGraphics();
		  g2.setBackground(Color.WHITE);//���ñ���ɫ
		  g2.clearRect(0, 0, width, height);//ͨ��ʹ�õ�ǰ��ͼ����ı���ɫ������������ָ���ľ��Ρ�
		  g2.setPaint(Color.BLUE);//���û���,����Paint����
		  //g2.drawOval(0, 0, 80, 80);
		  try {
			ImageIO.write(bi, "jpeg", file);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		  g2.dispose();
		  System.out.println("test");
	}

}
